<?php
defined('IN_IXDCW') or exit('Access Denied');
require DT_CORE . '/' . MODULE_NAME . '/common.inc.php';

// areaid
if (!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) {
	$areaid = $cityid;
	$ARE    = $AREA[$cityid];
}
// 获取类别
$CATEGORY  = PCache::read('category-40.php');


// area
$AREA          = PCache::read('area.php');
$currentAreaid = $cityid;

$areaid        = $currentAreaid;
$areaCondition = $currentAreaid ? "and areaid in (" . $AREA[$currentAreaid]['arrchildid'] . ")" : '';

$condition   = " status=3 and thumb!=''";
$sqlNewStore = "
	select * from " . $table . "
	where {$condition} " . $areaCondition . "
	order by addtime DESC limit 10";
$newStore    = $db->getAll($sqlNewStore);


// 服务商
$serviceid  = 5190;
$catService = __($CATEGORY)->filter(function ($item) use ($serviceid) {
	return $item['parentid'] == $serviceid;
});

// 销售商
$salerid  = 5189;
$catSaler = __($CATEGORY)->filter(function ($item) use ($salerid) {
	return $item['parentid'] == $salerid;
});

$province = __($AREA)->filter(function ($item) {
	return $item['parentid'] == 0;
});

$seo_file = 'index';
$MOD['name'] ='车企在线店';
include DT_INC.'/seo.inc.php';
include template('index', 'store');